<?php
	class lienketdb
	{
		public function Add($TenLienKet, $DiaChiLienKet)
		{
			$sql = "INSERT INTO `tbl_lienket`(`TenLienKet`, `DiaChiLienKet`) VALUES ('$TenLienKet', '$DiaChiLienKet')";
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
		
		public function Delete($MaLienKet)
		{
			$sql = "DELETE FROM `tbl_lienket` WHERE MaLienKet = $MaLienKet";
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
		
		public function Update($MaLienKet, $TenLienKet, $DiaChiLienKet)
		{
			$sql = "UPDATE `tbl_lienket` SET `TenLienKet`='$TenLienKet',`DiaChiLienKet`='$DiaChiLienKet' 
					WHERE MaLienKet = $MaLienKet";
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
		
		public function GetList()
		{
			$sql = "SELECT * FROM `tbl_lienket` WHERE 1";
			$data = new dataservice();
			return $data->ExecuteQuery($sql);
		}
		
		public function GetListByID($MaLienKet)
		{
			$sql = "SELECT * FROM `tbl_lienket` WHERE MaLienKet = $MaLienKet";
			$data = new dataservice();
			return $data->ExecuteQuery($sql);
		}
	}
?>